package cn.woniu.ecommerceplatform.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("Orders")
public class Orders {
    @Id
    @TableId
    private Integer id; //订单id
    private String orderNum; //订单编号
    private String goodImg; //商品图片
    private String goodName; //商品名称
    private Double goodPrice; //原价
    private Double deductionAmount; //积分抵扣金额
    private Double discount; //折扣价
    private Integer buyNum; //购买数量
    private Double actualPay; //实际支付金额

    @TableField(value = "create_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime; //创建时间
    private Integer orderState; //订单状态
    @TableField(value = "good_id")
    private Integer goodId; //商品id
    private String userAccount; //用户账号
    private String account; //管理员账号
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime; //发货时间
    private String goodCode; //商品编码
    private Integer comments; //是否评论
}
